entry: make sure priv->current_pos is valid
authorTimm Bäder <mail@baedert.org>
Mon, 6 Mar 2017 17:41:12 +0000 (18:41 +0100)
committerTimm Bäder <mail@baedert.org>
Mon, 13 Mar 2017 11:08:58 +0000 (12:08 +0100)
commit9047a5dc52fa31dec2dc8adcb73128ed82333385
treec8d2ab25d5500d76f642d246696d7e42f7de25d1
parentfca6bef697d8b1a285d1af8f6cc7a3b4df860d9e
entry: make sure priv->current_pos is valid

We can e.g. get the entry dispose()d and a focus_out event after that
(because the toplevel unsets the focus which previously was the entry).
We then later use priv->current_pos in a call to pango API which makes
sure the given index is valid for the given layout. Since we lazily
create a GtkEntryBuffer in get_buffer() and a PangoLayout lazily in
gtk_entry_create_layout, these 2 are always valid but don't match
priv->current_pos in this situation.

Fix this by resetting priv->current-pos in dispose().
gtk/gtkentry.c